package com.zy.design.state;

/**
 * @author hugx
 * @create 2018-09-13 10:20
 */
public class RuningDoorState implements LiftState {

    private StateContext context;

    @Override
    public void setStateConetxt(StateContext context) {
        this.context=context;
    }

    @Override
    public void openDoor() {

    }

    @Override
    public void closeDoor() {

    }

    /**
     * 在关闭runing状态下，电梯可以执行stop 操作
     */
    @Override
    public void runing() {
        System.out.println("电梯正在运行");
    }

    @Override
    public void stop() {
       context.setLiftState(context.stopDoorState);
       context.getLiftState().stop();
    }
}
